#include<iostream>
#include<vector>
#include<unordered_map>

using namespace std;

int main(){
	int m, n;
	cin>>m>>n;
	vector<vector<int>> bookings(m, vector<int>(3));
	for(int i=0;i<m;i++){
		cin>>bookings[i][0]>>bookings[i][1]>>bookings[i][2];
	}
	
	vector<int> nums(n);
    for (auto& booking : bookings) {
        nums[booking[0] - 1] += booking[2];
        if (booking[1] < n) {
            nums[booking[1]] -= booking[2];
        }
    }
    for (int i = 1; i < n; i++) {
        nums[i] += nums[i - 1];
    }

	for(int i=0;i<n;i++){
		cout<<nums[i]<<" ";
	}
	
	return 0;
} 
